Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement wire cutting as a two-qubit instruction #174

Merged
merged 15 commits into from
Jul 29, 2023
Merged

Conversation

garrison
Copy link
Member

@garrison garrison commented May 13, 2023

  • wait for Final (0.2.0) cutting workflow #153 to merge
  • add new Move instruction to Sphinx API References
  • write a tutorial notebook (preview here)
  • remove the "limitation" from the cutting explanatory
  • remove wire cutting as a unique feature of cutQC
  • release note

@garrison garrison added enhancement New feature or request cutting QPD-based circuit cutting code labels May 13, 2023
@garrison garrison added this to the 0.3.0 milestone May 13, 2023
@coveralls
Copy link

coveralls commented May 13, 2023

Pull Request Test Coverage Report for Build 5147223985

  • 30 of 30 (100.0%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.1%) to 89.476%

Totals Coverage Status
Change from base Build 5146966568: 0.1%
Covered Lines: 2355
Relevant Lines: 2632

💛 - Coveralls

@caleb-johnson
Copy link
Collaborator

We'll need to remove the "limitation" from the cutting explanatory when this goes in.

https://qiskit-extensions.github.io/circuit-knitting-toolbox/circuit_cutting/explanation/index.html

@caleb-johnson
Copy link
Collaborator

https://qiskit-extensions.github.io/circuit-knitting-toolbox/circuit_cutting/cutqc/index.html

We'll also need to remove wire cutting as a unique feature of cutQC in this PR

@garrison garrison marked this pull request as ready for review July 26, 2023 20:38
Copy link
Collaborator

@caleb-johnson caleb-johnson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great.

One question: I understand that the Move instruction decomposes to a swap and a reset when "decomposed" by Qiskit. What I don't understand is when in our workflow that SWAP happens or when we add the SingleQubitQPDGates containing the wire cut QPDBasis. Going to keep studying it but maybe you can say something about how this happens in our current workflow

circuit_knitting/cutting/instructions/move.py Outdated Show resolved Hide resolved
@caleb-johnson
Copy link
Collaborator

This looks great.

One question: I understand that the Move instruction decomposes to a swap and a reset when "decomposed" by Qiskit. What I don't understand is when in our workflow that SWAP happens or when we add the SingleQubitQPDGates containing the wire cut QPDBasis. Going to keep studying it but maybe you can say something about how this happens in our current workflow

After looking at the tutorial, I think #326 is what I was missing. Looks good, modulo the a small comment or two

Copy link
Collaborator

@caleb-johnson caleb-johnson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks really nice! LGTM 👍

@garrison garrison merged commit d9b1326 into main Jul 29, 2023
@garrison garrison deleted the wire-cutting branch July 29, 2023 01:21
caleb-johnson pushed a commit that referenced this pull request Jul 30, 2023
* Implement wire cutting as a two-qubit instruction

* Update type annotation

* s/gate/instruction/

* Add overhead test for `Move` instruction

* Add wire cutting tutorial

* Add `Move` to Sphinx build

* Doc updates suggested by Caleb

* Add release note and link to new tutorial

* Clarify wording

following #174 (comment)

* Improvements to `Move` docstring

* Use svg as the plot format

This avoids pixelation on high-dpi displays

* Remove unnecessary uses of `CircuitInstruction`

https://github.com/Qiskit-Extensions/circuit-knitting-toolbox/pull/174/files#r1278067109

* The notebook tests should ignore any files that crop up in `docs/_build`

`matplotlib.sphinxext.plot_directive` likes to leave python files there
garrison added a commit that referenced this pull request Aug 8, 2023
This is a follow-up to #174.  In that PR, `partition_problem` was not
described, but `execute_experiments` was mistakenly described
in two locations.
garrison added a commit that referenced this pull request Aug 8, 2023
This is a follow-up to #174.  In that PR, `partition_problem` was not
described, but `execute_experiments` was mistakenly described
in two locations.
caleb-johnson added a commit that referenced this pull request Aug 14, 2023
* Don't batch unnecessarily

* mypy

* black

* Missing varname

* fix bug

* Clean up code

* Improve comments

* release note

* release note

* Update batch-by-sampler-c4ae836df9997b1d.yaml

* Update batch-by-sampler-c4ae836df9997b1d.yaml

* Update batch-by-sampler-c4ae836df9997b1d.yaml

* Bump Python version in Dockerfile to 3.11 (#331)

Now that CKT supports Python 3.11, we might as well use the latest version in the Dockerfile.

* Fix formatting of example in `reduce_bitstrings` docstring (#332)

* Implement cutting of general 2-qubit unitaries (#302)

* Add support for `SwapGate`

* Reorder terms

[ci skip]

* Add missing terms

* DRY the coefficients

* Fix coverage

* Add support for `iSwapGate`

* Fix black

* Add to release note

* Fix type hint

* Gates without parameters are nicer to work with

and can be singletons, one day!

* Remove a line

* Add comments describing channels

* `_copy_unique_sublists`

* Add `DCXGate`

* Tweak

* Implement cutting of general 2-qubit unitaries

Builds on #294.  Closes #186.

* Add tests of additional gates

* Fix type annotation

* Add explanatory comments

* `supported_gates()` -> `explicitly_supported_gates()`

* Add to references

* Improved error message and test about `to_matrix` conversion failing

* Add xref to `QPDBasis` in docstrings

* Add `qpdbasis_from_gate` to Sphinx build

* Make `explicitly_supported_gates` private and remove its release note

It's not clear that this function remains useful now that we
support essentially all 2-qubit gates.  If we find a use for it
in the future, we can re-introduce it (or something like it) as a
public interface.

* Fix intersphinx link

* Release note

* Update qpd.py: remove extraneous `from None`

* Improve the instructions regarding pandoc (#336)

I've also tried to make the developer documentation easier to discover

* Make the repository link more obvious from the Sphinx build (#338)

* Make the repository link more obvious from the Sphinx build

* Enable "edit" link in the header

* Add comment

* Add README badge linking to stable documentation (#339)

* Add docs badge to link to stable docs

* Add ruff badge

* Remove ruff

* Update README.md (#340)

Making directions on opening the docs a little more succinct.

* Change var name

* Add SECURITY.md (#337)

* Implement wire cutting as a two-qubit instruction (#174)

* Implement wire cutting as a two-qubit instruction

* Update type annotation

* s/gate/instruction/

* Add overhead test for `Move` instruction

* Add wire cutting tutorial

* Add `Move` to Sphinx build

* Doc updates suggested by Caleb

* Add release note and link to new tutorial

* Clarify wording

following #174 (comment)

* Improvements to `Move` docstring

* Use svg as the plot format

This avoids pixelation on high-dpi displays

* Remove unnecessary uses of `CircuitInstruction`

https://github.com/Qiskit-Extensions/circuit-knitting-toolbox/pull/174/files#r1278067109

* The notebook tests should ignore any files that crop up in `docs/_build`

`matplotlib.sphinxext.plot_directive` likes to leave python files there

---------

Co-authored-by: Jim Garrison <[email protected]>
Co-authored-by: Ibrahim Shehzad <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cutting QPD-based circuit cutting code enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants